FIG. 1 is a diagram depicting a power supply 10 driving light emitting diodes (LEDs). The power supply 10 includes a bridge rectifier 14 for rectifying an AC voltage VAC and an offline converter 16 for providing an output current Io to an LED 12. Conventionally, the offline converter 16 adjusts the output current Io according to a dimming signal Sdim. As shown in FIG. 2, the output current Io is proportional to the voltage level of the dimming signal Sdim. The average of the output current Io determines the brightness of the LED 12, and thus the brightness of the LED 12 can be adjusted by changing the dimming signal Sdim.
However, as shown by waveforms 20 and 22 in FIG. 4, the input voltage VIN to the offline converter 16 has a periodic waveform, and thus the AC information of the input voltage VIN is necessary for the offline converter 16 to have a high power factor. As shown in FIG. 3, a conventional power-factor-improving method uses serially connected resistors R1 and R2 to divide the input voltage VIN for generating the dimming signal Sdim for the offline converter 16, which thus contains the AC component of the input voltage VIN, to improve the power factor of the offline converter 16. This approach, however, causes the average of the dimming signal Sdim to vary with the DC component of the input voltage VIN, so the average of the output current Io cannot be accurately controlled under the influence of the DC component of the input voltage VIN. FIG. 4 shows waveforms of the dimming signal Sdim under different input voltages VIN. When the input voltage VIN is higher, as shown by waveform 20, the input voltage VIN has a greater DC component VHavg, so the obtained dimming signal Sdim has a greater average Vavg1, as shown by waveform 24, thereby making the offline converter 16 provide a greater output current Io. When the input voltage VIN is lower, as shown by waveform 22, the DC component VLavg of the input voltage VIN is smaller, so the obtained dimming signal Sdim has a smaller average Vavg2, as shown by waveform 26, so the offline converter 16 provides a smaller output current Io.
Therefore, it is desired a circuit and method for improving the power factor and accurately controlling the output current of an offline converter.